<template>
  <div>
      <div class="total" v-loading.fullscreen.lock="loading">
          <div>
                <img style="width: 100%;"  src="@/assets/img/banner2.jpg"/>
            </div>
          <div class="title" v-html="title"></div>
          <div class="content" v-html="content"></div>
      </div>
  </div>
</template>

<script>
import '@/assets/js/index.js'
import { comart } from "@/api/apis";
export default {
data(){
        return{
            title:'',
            content:'',
            loading:true,
            id:''
        }
    },
    created(){
    //    console.log(this.$route.params)
       this.undergraduatedetail()          
    },
    activated(){
        // console.log('111',window.sessionStorage.getItem('college_id'))
        // if(window.sessionStorage.getItem('college_id')!=this.$route.params.id){
        //     this.undergraduatedetail() 
        // }
        if(this.id!=JSON.parse(JSON.stringify(this.$route.query))){
            this.undergraduatedetail()
        }
    },
    methods:{
       async undergraduatedetail(){
        //     if(JSON.stringify(this.$route.params)!=='{}'){
        //         window.sessionStorage.setItem('college_id',JSON.stringify(this.$route.params))
        //     }else{               
        //         window.sessionStorage.getItem('college_id')
        //     }
        // //    console.log(this.$route.params)           
        //   let a= JSON.parse(window.sessionStorage.getItem('college_id'))
        let a=JSON.parse(JSON.stringify(this.$route.query))
        this.id=a
          const {data:res}=await comart(a)
        //   console.log(res)
          this.title=res.data[0].title
          this.content=res.data[0].content
          this.loading=false
        //   let b=document.querySelector('.content')
        //   b.innerHTML=this.content

       }
    }

}
</script>

<style lang="less" scoped>
.el-breadcrumb{
    margin-top: 100px;
    font-size: 20px;
    font-weight: 600;
}
.total{
    font-size: 16px;
    width:10rem;
    margin: 0 auto;
    .title{
        margin:0 auto;
        width: 7rem;
        margin-top: .125rem;
        font-size: 30px;
        text-align: center;
    }
    .content{
        margin-top: .25rem;
        // height: 1000px;
        line-height: .5rem;
         width:10rem;
      /deep/  img{
            margin-left: 1.25rem;
            width:7.5rem;
            
        }
    }
}
</style>